/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.business.router.core.repository.entity;

import com.gitee.peigenlpy.actable.annotation.Column;
import com.gitee.peigenlpy.actable.annotation.Index;
import com.gitee.peigenlpy.actable.annotation.Table;
import com.gitee.peigenlpy.actable.annotation.Unique;
import com.gitee.peigenlpy.actable.constants.MySqlCharsetConstant;
import com.gitee.peigenlpy.actable.constants.MySqlEngineConstant;
import com.gitee.peigenlpy.actable.constants.MySqlTypeConstant;
import info.peigen.hotpot.business.router.facade.enums.ChannelCode;
import info.peigen.hotpot.common.core.enums.Currency;
import info.peigen.hotpot.component.data.repository.beetlsql.entity.AbstractCreateTimeEntity;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.FieldDefaults;

/**
 * <b>(PayeeCardEntity)</b>
 * 路由-收款卡表
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2021/8/1
 */
@EqualsAndHashCode(callSuper = true)
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults(level = AccessLevel.PRIVATE)
@Accessors(chain = true)
@Table(name = "router_receipt_card", comment = "路由-收款卡表", charset = MySqlCharsetConstant.UTF8MB4, engine = MySqlEngineConstant.InnoDB)
@org.beetl.sql.annotation.entity.Table(name = "router_receipt_card")
public class ReceiptCardEntity extends AbstractCreateTimeEntity {
    @Column(name = "card_id", type = MySqlTypeConstant.VARCHAR, length = 30, isNull = false, comment = "cardId")
    @Unique(value = "cardId", columns = "card_id")
    @org.beetl.sql.annotation.entity.Column("card_id")
    String      cardId;
    @Column(name = "code", type = MySqlTypeConstant.VARCHAR, length = 50, isNull = false, comment = "收款渠道编码")
    @Index(value = "code", columns = "code")
    @org.beetl.sql.annotation.entity.Column("code")
    ChannelCode code;
    @Column(name = "card_name", type = MySqlTypeConstant.VARCHAR, length = 50, comment = "卡姓名")
    @org.beetl.sql.annotation.entity.Column("card_name")
    String      cardName;
    @Column(name = "card_no", type = MySqlTypeConstant.VARCHAR, length = 50, isNull = false, comment = "卡号")
    @org.beetl.sql.annotation.entity.Column("card_no")
    @Index(value = "cardNo", columns = "card_no")
    @Unique(value = "cardNo", columns = "code,card_no,currency")
    String      cardNo;
    @Column(name = "currency", type = MySqlTypeConstant.VARCHAR, length = 3, isNull = false, comment = "币种")
    @Index(value = "currency", columns = "currency")
    @org.beetl.sql.annotation.entity.Column("currency")
    Currency    currency;
}